package com.cndym.adapterForMobile.mobile.function;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.cndym.adapterForMobile.BaseFunction;
import com.cndym.exception.ErrCode;
import com.cndym.utils.Utils;
import com.zch.matches.producer.ISportMatchesProducer;

/**
 * 期次查询均赔
 * @author wuxiuwei
 *
 */
@Component
public class IssueAvgOddsSportMatchesFunc extends BaseFunction {

	@Autowired
	private ISportMatchesProducer sportMatchesProducer;
	
	@Override
	public Map<String, String> function(Map<String, String> map) {
		Map<String, String> param = paraMap(map);
		String lotteryCode = param.get("lotteryCode");
		String issue = param.get("issue");
		String sn = param.get("sn");
		if(Utils.isEmpty(lotteryCode)){
			return noBodyReMap(ErrCode.E3300);
		}
		if(Utils.isEmpty(issue)){
			return noBodyReMap(ErrCode.E4508);
		}
		if (Utils.isEmpty(sn)) {
			return noBodyReMap(ErrCode.E4509);
		}
		Map<String, Object> resMap = null;
		resMap=sportMatchesProducer.issueAvgOddsSportMatches(param);
		return successObj(resMap);
	}
}

